//
//  Model.h
//  CandyJump
//
//  Created by Bon Lam on 26/02/2011.
//  Copyright 2011 Peru Republic. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "chipmunk.h"
#import "ccTypes.h"

// Base class of all the objects on the map. No physics body. Only a sprite
//=====================================================================================================================
@class CCSprite;
@interface Model : NSObject {

	//	Data
	NSString *batchnodeName;
	NSString *defaultFrameName;
	NSString *defaultAnimationName;
	NSDictionary *animationDictionary;
	
	//	Instance variable
	CGPoint	renderOffset;
	BOOL xFlip, yFlip;
	
	CCSprite *sprite;
}

//---------------------------------------------------------------------------------------------------------------------
@property (nonatomic, readwrite, retain) NSString *batchnodeName;
@property (nonatomic, readwrite, retain) NSString *defaultFrameName;
@property (nonatomic, readwrite, retain) NSString *defaultAnimationName;
@property (nonatomic, readwrite, retain) NSDictionary *animationDictionary;

@property (nonatomic, readwrite, assign) CGPoint renderOffset;
@property (nonatomic, readwrite, retain) CCSprite *sprite;


#pragma mark Model - Object Functions
- (id)init;
- (void)dealloc;
- (id)copyWithZone:(NSZone *)zone;

- (void)setValue:(id)value forUndefinedKey:(NSString *)key;

#pragma mark Model - Setters and Getters


#pragma mark Model - Physics
- (void)setUpPhysics:(cpSpace *)space;

#pragma mark Model - Sprite
- (void)removeSpriteFromParent;
- (void)playAnimation:(NSString*)animationName;

#pragma mark Model - Update
- (void)update:(ccTime)dt;

@end
